<?php
if(!empty($_REQUEST["action"])){
	try{
		$action=explode('/', $_REQUEST['action']);
		$class_name=$action[0];
		$method_name=$action[1];
		$url='../control/'.$class_name.'.php';
		require ($url);
		$class=new ReflectionClass($class_name);
		if(class_exists($class_name)){
			if($class->hasMethod($method_name)){
				$func=$class->getMethod($method_name);
				$instance=$class->newInstance();				
				$func->invokeArgs($instance,array($_REQUEST));
				$result=$instance->getResult();
				echo $result;
			}
		}
	}
	catch (Exception $e){
		echo $e->getTraceAsString();
	}
}
?>